import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'state.dart';

class LoginLogic extends GetxController {
  final state = LoginState();
  TextEditingController uNController;
  TextEditingController pwdController;

  LoginLogic(){
    uNController = TextEditingController();
    pwdController = TextEditingController();
  }

  @override
  onInit() {
    _bindListener();
    super.onInit();
  }

  @override
  onClose() {

    super.onClose();
  }

  _bindListener() {
    uNController.addListener(() {
      state.userName.value = uNController.text;
    });

    pwdController.addListener(() {
      state.pwd.value = pwdController.text;
    });
  }
}
